import { Entity, Column } from 'typeorm';
import {BaseEntity} from "@/entitys/common/baseEntity";

enum QuoteState {
    delete = "-1",
    normal = "1"
}

@Entity({comment: "报价管理"})
export class Quote extends BaseEntity{

    @Column({comment: '客户名'})
    clienteleName: string;

    @Column({comment: '线路名称'})
    itineraryName: string;

    @Column({comment: '线路详情', type: "json"})
    itineraryList: any;

    @Column({comment: '发团时间', type: 'date', nullable: true})
    startDate: Date;

    @Column({comment: '散团时间', type: 'date', nullable: true})
    endDate: Date;

    @Column({comment: '成人数', default: 0})
    adult: number;

    @Column({comment: '儿童人数', default: 0})
    child: number;

    @Column({comment: '领队人数', default: 0})
    leader: number;

    @Column({comment: '老人数', default: 0})
    old: number;

    @Column({comment: '报价人ID'})
    quoterId: number;

    @Column({comment: '报价人', nullable: true})
    quoter: string;

    @Column({comment: '报价电话'})
    quoterPhone: string;

    @Column({comment: '报价有效期', type: 'date', nullable: true})
    quotationValidity: Date;

    @Column({comment: '产品特色', nullable: true})
    productFeatures: string;

    @Column({comment: '自费信息', nullable: true})
    optionalExpenses: string;

    @Column({comment: '购物信息', nullable: true})
    shoppingInfo: string;

    @Column({comment: '注意事项', nullable: true})
    importantNotes: string;

    @Column({comment: '报价信息', type: "json"})
    quoteList: any[];

    @Column({
        comment: '状态',
        type: "enum",
        enum: QuoteState,
        default: QuoteState.normal
    })
    state: QuoteState;

    @Column('json', { nullable: true })
    properties: any
}